package de.akabahn.ebd.dbd;

/**
 * Enum defining the positions of a switch as they are defined by the DBD
 * server.
 * 
 * @author Peter Eimann
 * @since 0.2
 * @version 1.0
 */
public enum SwitchPosition {
	UNDEFINED(0), LEFT(1), RIGHT(2);

	private int position;

	SwitchPosition(int position) {
		this.position = position;
	}

	public int getPosition() {
		return position;
	}

	public static SwitchPosition fromValue(int position) {
		switch (position) {
		case 0:
			return UNDEFINED;
		case 1:
			return LEFT;
		case 2:
			return RIGHT;
		default:
			return null;
		}
	}
}
